﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using University.Workshop.Business;

namespace University.Workshop.Presenters
{
    public class PresenterSendMail: BasePresenter<ISendMailView>
    {
        public PresenterSendMail(ISendMailView view):base(view)
        {

        }
        public void SendNewEmail()
        {
            try
            {
                SendMailManager.ValidateToSend(View.ToEmail, View.Password, View.Subject, View.From, View.Message, View.File);
                View.MessageWarnings = "Send Mail From "+View.From+" Complete";
            }
            catch (ArgumentException ex)
            {
                View.MessageWarnings = ex.Message;
            }
        }
    }
}
